<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set value="${pageContext.request.contextPath}" var="path"></c:set>
<link rel="stylesheet" type="text/css" href="${path}/static/web/css/EditStyle.css"/>
<html>
<head>
    <title>修改车辆信息</title>
</head>
<body>
<script type="text/javascript" src="${path}/static/web/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
    <!-- 添加提交事件 -->
        $(function (){
            $("#myform").submit(check);
            $("#cancel").click(cancel);
        });
        function check()
        {
            var ftel = checktel();
            var fpwd = checkPwd1();
            return ftel&&fpwd;
        }
        function cancel(){
            location.href="${path}/web/checkcar";
        }


    <!-- 验证车牌号是否为空并且车牌号是否一致-->
        $(function (){
            $("#carmess1").blur(checkPwd1);
        });
        function checkPwd1()
        {
            var carmess1 = $("#carmess1").val();
            var carmess2 = $("#carmess2").val();
            if(carmess1==carmess2&&carmess1!="")
            {
                $("#carmess1Rs").css("color","green");
                $("#carmess1Rs").html("√");

                return true;
            }
            else
            {
                $("#carmess1Rs").css("color","red");
                $("#carmess1Rs").html("x");

                return false;
            }
        }
    </script>


<form action="${path}/web/updateCarMess">
    <input type="hidden" name="id" value="${requestScope.car.id}">
<table style=" margin:50px auto;">
        <tr><td>原车牌号:</td><td> <input value="${requestScope.car.license}"></td></tr>
        <tr><td>输入新车牌号:</td><td> <input  name="license" v id="carmess1" placeholder="请输入您的车牌号"><span id="carmess1Rs" ></span></td></tr>
        <tr><td>确认新车牌号:</td><td>  <input    id="carmess2" placeholder="请再次输入您的车牌号"></td></tr>
<tfoot>
<tr><td><input type="submit" value="更改">&nbsp;<input type="button" value="取消" id="cancel"> </td></tr><
</tfoot>


</table>
</form>

</body>
</html>
